home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload Trio 2
/
Shareware Overload Trio Volume 2 (Chestnut CD-ROM).ISO
/
dir31
/
randmod.zip
/
RANDMOD.DOC
< prev
next >
Wrap
Text File
|
1994-06-16
|
9KB
|
186 lines
R ■ A ■ N ■ D ■ M ■ O ■ D
version 2.1
The random music file selector.
(C)opyright 1994 Jesse Morris
RandMod is a utility that will randomly select a music file (such
as a .mod file) and load up another program to play it. The advantage
of this, as opposed to having RandMod play the file itself, is twofold.
First of all, RandMod stays small, and compact. Secondly, it is
entirely detatched from the hardware, so it will work with any sound
card or music system you like. There are some excellent .mod players
out there, and this will let you use them in just one other way. It is
a fairly complex piece of software, capable of some rather sophisticated
things. Here's how it works.
Creating a Configuration File
In order for RandMod to function properly, you must let it know
which music players you have present. You do this by creating or editing
a file called RandMod.Cfg. This file should contain, on seperate lines,
a list of all of the music players that you have present. It should
contain the full filename.
You may also, after each line, list what command line arguments
that particular player needs. However, you MUST begin these lines with
the left square bracket character. ("[") If you like, you may end this
line with a right square bracket ("]") but it is not necessary.
For instance, a configuration file might read as follows:
WOWII.EXE
[ /H:44100 /DMA:1 ]
PLAY.EXE
DMP.EXE
[ -n32 ]
GUSMOD.EXE
metal.exe
[-ss -v96]
\s3m\ENJOYs3m.EXE
And so on. The only limit to how many music players you can
have in RandMod.Cfg is how many you can fit on your disk. All of the
players specified must be able to be driven from the command line,
obviously.
Choosing a Music Player
You can, at runtime, tell RandMod to chose a specific music
player from the list specified in RandMod.Cfg. (If you do not, it will
default to the first one.) You can do this with the -p<x> parameter,
where x is the number of the player to use. So, if you typed
C:\SOUND\MUSIC\UTILS> RandMod /p2
RandMod would chose the second music player listed in RandMod.cfg file.
Choosing What to Play
You can also tell RandMod what files to chose from in it's
selection. You do this by simply entering, as a parameter, the file
mask (such as *.*) you wish RandMod to chose from. You may use multiple
masks if you wish. If you do not specify one, RandMod will chose from
all of the files in the current directory with a .mod extention.
Some examples of possible file masks:
C:\SOUND\MUSIC\UTILS> RandMod.Exe ..\mod\*.mod ..\s3m\*.s3m d:b*.stm
This will chose one of the files that satisfy any of those qualifications.
If this does not allow you enough flexability, you may also opt to
create a list file. This is a file containing a list of pieces to chose
from. It is in ascii format, with each line consisting of a filename, and
(optionally) a couple of spaces and a weighting. With this you can make
playback of certain files more probable than others. It's all relative, so
a file with a weighting of two plays back twice as often as one of one,
while a file with a weighting of three is chosen as often as the other two
combined. A sample list file is as follows:
2ND_PM.S3M 4
2ND_SKAV.S3M 7
AQUA.S3M
CCITY12.S3M 3
CHAOS.S3M 9
EXPLORAT.S3M 6
GMOTION.S3M
SATELL.S3M 4
SPRING.S3M 5
STRSHINE.S3M 8
SYMPHONY.S3M 6
TURBULEN.S3M 5
Bear in mind that any file that fits into more than one of the file
masks, or is in some referenced more than once will be played more often
than one than is only mentioned once. So if you select b*.* as well as
*.mod, every file that fits into b*.mod will pop up twice as often as any
other.
Displaying The Song Name
When RandMod selects a file to play, it will attempt to extract the
song name from it. This will only work for music file formats in which the
title is in the first couple of bytes. (for instance, .mod, .s3m, and some
other similar formats) If the module name consists of other, non-printable
characters, it will not be displayed.
RandMod has the option of delaying a period of time before actually
loading up the music player. This is to give you time to read the title,
and decide if you really want to play it. If you do, you can wait, or
press almost any key, and it will proceed to play the file. However, if
you would like to abort the playback (perhaps this given file crashes that
specific player, or you just don't feel like listening to it) you may do so
by pressing the ESC key. If you press 'Q' it will also abort the playback
and generate an error code of 32767, which may be useful to write interactive
batch files. The period of time to wait (in clock ticks, or approximately
1/18.2 of a second) may be specified with the /w paramater.
In fact, a batch file is included in the RandMod zip file. It is
called simply Repeater.Bat. When run, it will randomly select a file with
RandMod, using the default player. It will then, when finished with that
music file, (unless you abort RandMod with the 'Q' key) repeat the whole
process. (If RandMod is aborted with the 'Q' key, the batch file will exit)
One use of this is (if you have a multitasking OS friendly DOS music
player) to have it running in a DOS task, in the background.
You can use Repeater.Bat just as you would use RandMod. It passes
any command line switches on to RandMod, and specifies none itself.
By the way: If you are at all into Modfiles, and don't already
have one, get a Gravis UltraSound. It delivers incredible sound quality,
and is easy to program for.
Also: This program is indeed ShareWare. If you like it or use it
or both, please send me a modest $5. I'll then be encouraged to write more
useful software. If you don't like it, you can send me money and a list of
programs you would find usefull. (or send me just the list, and the money
when I'm done writing it.) Of course, registered users will also recieve
updates to RandMod, and most likely a discount from the registration of my
next release, whatever that may be.
In case you're interested, here are all the ideas for programming
projects I have been writing and/or considering writing:
RandMod (of course!) A Text Adventure (involving time travel)
ModMaster, a GUI shell Misc. Fun Graphics Stuff UltraTetris!
A nifty, colourful spectrum analyzer to run on your sound card's line-in.
VGA CoreWars (version 1.2 -- 1.1's already out! Look for it!)
In the distant future, I am thinking of writing a screen saver that looks
as good as some of the major demos out today do.
If any of these ideas appeal to you, let me know. If I hear any
interest in any of them, I will be MUCH more likely to work on them.
If you want to register, if you want to suggest an interesting new
programming project, or 'vote for' one of the ones I've listed, or have a
question, or even (god forbid!) a BUG REPORT, please contact me. I can be
reached at the following addresses:
InterNet!!!
jmorris@ace.com (mail only. :-( if you know where I can get a free
full account, let me know!!!)
WWIV Net, ICENET, WEBNET:
229@6754
If you're not into telecommunications,
ExpressNet you can reach me at the following
229@1 address:
Jesse Morris
Rangeley Software
42 Rangeley Rd
Winchester, MA, 01890, USA
Even if you have no intention of registering whatsoever, if you do use this
software for long enough to have bothered reading through the documentation,
you MUST send me something saying that you use and/or like it. Any
suggestions, hints, criticisms, or anything else are all welcome. This is
only my second piece of software released, and I am very curious to see how
many people use it.
OH! In case you were wondering, I wrote this with Turbo C++
version 3.1. Any bugs you encounter are Borland's fault, and not mine, of
course. :) (If you want to fund me in purchasing BC++ 4.0, feel free!)